import models as seriemodels
from django.contrib import admin
from transmeta import canonical_fieldname

class SerieAdmin(admin.ModelAdmin):
        list_display = ('name_es', 'description_es')
        list_filter = ['name_es']
        search_fields = ['name_es','description_es']
        prepopulated_field = {"slug": ("name_en",)}
        class Media:
                js = ('/media/js/tiny_mce/tiny_mce.js', '/media/js/textareas.js')


class CapituloAdmin(admin.ModelAdmin):
        list_display = ('serie', 'name_es','usa_date','spain_date')
        list_filter = ['serie', 'usa_date','spain_date']
        search_fields = ['name_es']
        date_hierarchy = 'usa_date'
    
admin.site.register(seriemodels.Serie, SerieAdmin)
admin.site.register(seriemodels.Capitulo, CapituloAdmin)